#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n;
int a[100010],num[100010],sum[100010];
int jian=0;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i++){
        num[a[i]]++;
    }
    sum[a[1]]=0;
    for(int i=a[1]+1;i<=a[n];i++){
        sum[i]=sum[i-1]+num[i-1];
    }
    //for(int i=1;i<=a[n];i++){
    //    cout<<sum[i]<<" "<<num[i]<<endl;
    //}
    for(int i=a[1]+1;i<=a[n];i++){
        sum[i]-=jian;
        jian+=min(sum[i],num[i]);
    }
    //cout<<jian<<endl;
    printf("%d",n-jian);
    return 0;
}
